<?php

namespace app\controller\api;

use share\controller\ApiBaseController;
use app\validate\PrivacyValidate;
use app\service\PrivacyService;
use share\utils\Helper;

class PrivacyController extends ApiBaseController{
    public function initValidate(){        
        $this->validate = new PrivacyValidate();
    }

    // public function list_action(){  
    //     $input = $this->check();        
    //     $page = $this->check('pageInfo',null,(new PageValidate()));        
    //     $data = PrivacyService::getListInfo($input,$page);
    //     $total = PrivacyService::getListCountInfo($input);
    //     return self::ok(self::formatPageData($page,$total,$data));    
    // }

    public function last_time_action(){  
        $input = $this->check();
        $lang = $input['language'];
        $res = PrivacyService::getLastByLanguage($lang); 
        $res = Helper::arrayUnderscoreToCamelKey($res);
        return self::ok($res);
    }

}